﻿Imports System.Windows.Forms

Public Class frmUTMProjection

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub frmUTMProjection_FormClosed(sender As Object, e As System.EventArgs) Handles Me.FormClosed
        SaveControlValues(REGAPP, Me)
    End Sub

    Private Sub frmUTMProjection_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        GetControlValues(REGAPP, Me)
    End Sub

    Friend Property SelectedZoneNumber As Integer
        Get
            For Each cntl As Control In tblZone.Controls
                If cntl.Name.StartsWith("opt") AndAlso CType(cntl, RadioButton).Checked Then Return Val(cntl.Name.Replace("opt", ""))
            Next
            Return 0
        End Get
        Set(value As Integer)
            For Each cntl As Control In tblZone.Controls
                If cntl.Name.StartsWith("opt") AndAlso Val(cntl.Name.Replace("opt", "")) = value Then CType(cntl, RadioButton).Checked = True
            Next
        End Set
    End Property
End Class
